<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="../css/docs.css" type="text/css" rel="stylesheet" />
<link href="../css/prettify.css" type="text/css" rel="stylesheet" />
<script src="../js/prettify.js" type="text/javascript"></script>
</head>
<body onLoad="prettyPrint()">
<div class="g-unit" id="doc-content">
<div id="api-info-block">
    <div class="api-level">H3C CAS云管理平台</div>
  </div>
  <div id="jd-header">
    <h1>增加备份策略</h1>
  </div>
</div>
<div id="jd-content">
<div class="jd-descr">
<p>根据指定的参数增加备份策略。</p>
<h2><a name="uri"></a>接口 URI</h2>
<p>/cas/casrs/backupStrategy/addBackupStrategy</p>
<h2><a name="access"></a>访问方法</h2>
<dl>
  <dt><b>HTTP 方法</b></dt>
  <dd>POST</dd>
  <dt><b>消息体</b></dt>
  <div class="source">
  	<pre class="prettyprint lang-xml">&lt;backupStrategy&gt;<br>    &lt;name&gt;名称&lt;/name&gt;<br>    &lt;description&gt;description&lt;/description&gt;<br>    &lt;storeMode&gt;1&lt;/storeMode&gt;<br>    &lt;storeLocation&gt;/vms/store&lt;/storeLocation&gt;<br>    &lt;targetAddr&gt;192.168.0.1&lt;/targetAddr&gt;<br>    &lt;loginName&gt;root&lt;/loginName&gt;<br>    &lt;password&gt;root&lt;/password&gt;<br>    &lt;frequency&gt;0&lt;/frequency&gt;<br>    &lt;day&gt;5&lt;/day&gt;<br>    &lt;hour&gt;7&lt;/hour&gt;<br>    &lt;minutes&gt;0&lt;/minutes&gt;<br>    &lt;state&gt;0&lt;/state&gt;<br>    &lt;incBackupFlag&gt;2&lt;/incBackupFlag&gt;<br>    &lt;incBackupFrequency&gt;1&lt;/incBackupFrequency&gt;<br>    &lt;incBackupDay&gt;3&lt;/incBackupDay&gt;<br>    &lt;incBackupHour&gt;7&lt;/incBackupHour&gt;<br>    &lt;incBackupMinutes&gt;0&lt;/incBackupMinutes&gt;<br>    &lt;serverType&gt;0&lt;/serverType&gt;<br>    &lt;updateVMList&gt;true&lt;/updateVMList&gt;<br>    &lt;backupThreshold&gt;10&lt;/backupThreshold&gt;
    &lt;keepTimes&gt;5&lt;/keepTimes&gt;<br>    &lt;hourEnd&gt;8&lt;/hourEnd&gt;<br>    &lt;minutesEnd&gt;0&lt;/minutesEnd&gt;<br>    &lt;incHourEnd&gt;8&lt;/incHourEnd&gt;<br>    &lt;incMinutesEnd&gt;10&lt;/incMinutesEnd&gt;<br>    &lt;vmList&gt;<br>        &lt;domainId&gt;313&lt;/domainId&gt;<br>    &lt;/vmList&gt;<br>    &lt;vmList&gt;<br>        &lt;domainId&gt;312&lt;/domainId&gt;<br>    &lt;/vmList&gt;<br>&lt;/backupStrategy&gt;</pre>
  </div>
</dl>

<dt><a name="detail"></a><b>元素含义</b></dt>
  <table id="pubmethods" class="jd-sumtable">
    <tbody>
      <tr>
        <th colspan="2"><span class="prettyprint lang-xml">backupStrategy</span>各子元素</th>
      </tr>
      <tr>
        <td class="jd-typecol"><span class="prettyprint lang-xml">name</span></td>
        <td width="100%" class="jd-linkcol"><span class="sympad">备份策略名称，名称的最大输入长度为32个字符，且只允许输入汉字、字母、数字、减号、下划线及点。</span>
          <div class="jd-descrdiv">字符串（String）类型，必须。</div></td>
      </tr>
      <tr class="alt-color">
        <td class="jd-typecol"><span class="prettyprint lang-xml">description</span></td>
        <td class="jd-linkcol"><span class="sympad">描述，最大输入长度为120个字符。</span>
          <div class="jd-descrdiv">字符串（String）类型，可选项。</div></td>
      </tr>
      <tr>
        <td class="jd-typecol"><span class="prettyprint lang-xml">storeMode</span></td>
        <td class="jd-linkcol"><span class="sympad">备份类型：0：共享文件系统；1：远端服务器。</span>
          <div class="jd-descrdiv">整型（Integer）类型，必须。</div></td>
      </tr>
	  <tr class="alt-color">
        <td class="jd-typecol"><span class="prettyprint lang-xml">storeLocation</span></td>
        <td class="jd-linkcol"><span class="sympad">共享文件位置。</span>
          <div class="jd-descrdiv">字符串（String）类型，必须。</div></td>
      </tr>
      <tr>
        <td class="jd-typecol"><span class="prettyprint lang-xml">targetAddr</span></td>
        <td class="jd-linkcol"><span class="sympad">目的的服务器IP地址</span>
          <div class="jd-descrdiv">字符串（String）类型，当 storeMode 为 1：远端服务器 时 必须。</div></td>
      </tr>
      <tr class="alt-color">
        <td class="jd-typecol"><span class="prettyprint lang-xml">loginName</span></td>
        <td class="jd-linkcol"><span class="sympad">目的服务器用户名。</span>
            <div class="jd-descrdiv">字符串（String）类型，当 storeMode 为 1：远端服务器 时 必须。</div></td>
      </tr>
      <tr>
        <td class="jd-typecol"><span class="prettyprint lang-xml">password</span></td>
        <td class="jd-linkcol"><span class="sympad">目的服务器密码。</span>
            <div class="jd-descrdiv">字符串（String）类型，当 storeMode 为 1：远端服务器 时 必须。</div></td>
      </tr>
      <tr class="alt-color">
        <td class="jd-typecol"><span class="prettyprint lang-xml">frequency</span></td>
        <td class="jd-linkcol"><span class="sympad">备份策略的频率,0:每月，1：每周，2：每日。</span>
            <div class="jd-descrdiv">整型（Integer）类型，必须。</div></td>
      </tr>
      <tr>
        <td class="jd-typecol"><span class="prettyprint lang-xml">day</span></td>
        <td class="jd-linkcol"><span class="sympad">备份策略的日期。</span>
            <div class="jd-descrdiv">整型（Integer）类型，必须。</div></td>
      </tr>
      <tr class="alt-color">
        <td class="jd-typecol"><span class="prettyprint lang-xml">hour</span></td>
        <td class="jd-linkcol"><span class="sympad">备份策略的时间：时。</span>
            <div class="jd-descrdiv">整型（Integer）类型，必须。</div></td>
      </tr>
      <tr>
        <td class="jd-typecol"><span class="prettyprint lang-xml">minutes</span></td>
        <td class="jd-linkcol"><span class="sympad">备份策略的时间：分。</span>
            <div class="jd-descrdiv">整型（Integer）类型，必须。</div></td>
      </tr>
      <tr class="alt-color">
        <td class="jd-typecol"><span class="prettyprint lang-xml">state</span></td>
        <td class="jd-linkcol"><span class="sympad">备份策略是否生效  1：生效，0：无效。</span>
            <div class="jd-descrdiv">整型（Integer）类型，必须。</div></td>
      </tr>
      <tr>
        <td class="jd-typecol"><span class="prettyprint lang-xml">incBackupFlag</span></td>
        <td class="jd-linkcol"><span class="sympad">是否启用增量备份：不启用：0，启用增量备份：1，启用差异备份：2。</span>
            <div class="jd-descrdiv">整型（Integer）类型，必须。</div></td>
      </tr>
      <tr class="alt-color">
        <td class="jd-typecol"><span class="prettyprint lang-xml">incBackupFrequency</span></td>
        <td class="jd-linkcol"><span class="sympad">频率:，1：每周，2：每日，3：每小时。</span>
            <div class="jd-descrdiv">整型（Integer）类型，当incBackupFlag为1：启用增量备份或2：启用差异备份时必须。</div></td>
      </tr>
      <tr>
        <td class="jd-typecol"><span class="prettyprint lang-xml">incBackupDay</span></td>
        <td class="jd-linkcol"><span class="sympad">哪天：几日，或星期几，每天 。</span>
            <div class="jd-descrdiv">整型（Integer）类型，当incBackupFlag为1：启用增量备份或2：启用差异备份时必须。</div></td>
      </tr>
	  <tr class="alt-color">
        <td class="jd-typecol"><span class="prettyprint lang-xml">incBackupHour</span></td>
        <td class="jd-linkcol"><span class="sympad">增量备份的时间：时。</span>
            <div class="jd-descrdiv">整型（Integer）类型，当incBackupFlag为1：启用增量备份或2：启用差异备份时必须。</span>。</div></td>
      </tr>
      <tr>
        <td class="jd-typecol"><span class="prettyprint lang-xml">incBackupMinutes</span></td>
        <td class="jd-linkcol"><span class="sympad">增量备份的时间：分。</span>
            <div class="jd-descrdiv">整型（Integer）类型，当incBackupFlag为1：启用增量备份或2：启用差异备份时必须。</div></td>
      </tr>
	  <tr class="alt-color">
        <td class="jd-typecol"><span class="prettyprint lang-xml">serverType</span></td>
        <td class="jd-linkcol"><span class="sympad">服务器类型，0：选择FTP，1:选择SCP。</span>
            <div class="jd-descrdiv">整型（Integer）类型，当 storeMode 为 1：远端服务器 时 必须。</div></td>
      </tr>
	  <tr>
        <td class="jd-typecol"><span class="prettyprint lang-xml">updateVMList</span></td>
        <td class="jd-linkcol"><span class="sympad">是否更新虚拟机列表。</span>
            <div class="jd-descrdiv">布尔（boolean）类型，必须，默认为true。</div></td>
      </tr>
	  <tr class="alt-color">
        <td class="jd-typecol"><span class="prettyprint lang-xml">backupThreshold</span></td>
        <td class="jd-linkcol"><span class="sympad">磁盘I/O阈值(MB)。</span>
            <div class="jd-descrdiv">整型（Integer）类型，必须。</div></td>
      </tr>
	  <tr>
        <td class="jd-typecol"><span class="prettyprint lang-xml">keepTimes</span></td>
        <td class="jd-linkcol"><span class="sympad">全量备份保留个数。</span>
            <div class="jd-descrdiv">整型（Integer）类型，可选。</div></td>
      </tr>
	  <tr class="alt-color">
        <td class="jd-typecol"><span class="prettyprint lang-xml">hourEnd</span></td>
        <td class="jd-linkcol"><span class="sympad">全量备份时间段截止小时。</span>
            <div class="jd-descrdiv">整型（Integer）类型，必须。</div></td>
      </tr>
	  <tr>
        <td class="jd-typecol"><span class="prettyprint lang-xml">minutesEnd</span></td>
        <td class="jd-linkcol"><span class="sympad">全量备份时间段截止分。</span>
            <div class="jd-descrdiv">整型（Integer）类型，必须。</div></td>
      </tr>
	  <tr class="alt-color">
        <td class="jd-typecol"><span class="prettyprint lang-xml">incHourEnd</span></td>
        <td class="jd-linkcol"><span class="sympad">增量备份时间段截止小时。</span>
            <div class="jd-descrdiv">整型（Integer）类型，当incBackupFlag为1：启用增量备份或2：启用差异备份时必须。</div></td>
      </tr>
	  <tr>
        <td class="jd-typecol"><span class="prettyprint lang-xml">incMinutesEnd</span></td>
        <td class="jd-linkcol"><span class="sympad">增量备份时间段截止分。</span>
            <div class="jd-descrdiv">整型（Integer）类型，当incBackupFlag为1：启用增量备份或2：启用差异备份时必须。</div></td>
      </tr>
	  <tr class="alt-color">
        <td class="jd-typecol"><span class="prettyprint lang-xml">vmList</span></td>
        <td class="jd-linkcol"><span class="sympad">备份策略的虚拟机信息。</span>
            <div class="jd-descrdiv">集合（List）类型。</div></td>
      </tr>
    </table>
	<table id="pubmethods" class="jd-sumtable">
    <tbody>
      <tr>
        <th colspan="2">vmList各子元素</th>
      </tr>
      <tr>
        <td class="jd-typecol"><span class="prettyprint lang-xml">domainId</span></td>
        <td class="jd-linkcol"><span class="sympad">虚拟机ID。</span>
          <div class="jd-descrdiv">长整型（Long）类型，必须。</div></td>
      </tr>
  </table>

<h2><a name="result"></a>返回结果</h2>
<dl>
  <dt><b>状态码</b></dt>
  <dd>
  <ul>
    <li>HTTP/1.1 204 No Content：成功。</li>
    <li>409(Conflict)：失败。 </li>
  </ul>
  </dd>
  <dt><b>回应</b></dt>
  <div class="source">
    <pre class="prettyprint lang-xml">无</pre>
  </div>
  <dt>&nbsp;</dt>
</dl>
<dt>
    <h2><a name="example"></a>应用举例</h2>
    <p>创建备份策略名称1。</p>
    <dl>
      <dt><b>请求</b></dt>
      <div class="source">
        <pre class="prettyprint lang-xml">POST http://192.168.10.80:8080/cas/casrs/backupStrategy/addBackupStrategy
accept: application/xml


&lt;backupStrategy&gt;<br>    &lt;name&gt;名称1&lt;/name&gt;<br>    &lt;description&gt;description&lt;/description&gt;<br>    &lt;storeMode&gt;1&lt;/storeMode&gt;<br>    &lt;storeLocation&gt;/vms/store&lt;/storeLocation&gt;<br>    &lt;targetAddr&gt;192.168.0.1&lt;/targetAddr&gt;<br>    &lt;loginName&gt;root&lt;/loginName&gt;<br>    &lt;password&gt;root&lt;/password&gt;<br>    &lt;frequency&gt;0&lt;/frequency&gt;<br>    &lt;day&gt;5&lt;/day&gt;<br>    &lt;hour&gt;7&lt;/hour&gt;<br>    &lt;minutes&gt;0&lt;/minutes&gt;<br>    &lt;state&gt;0&lt;/state&gt;<br>    &lt;incBackupFlag&gt;2&lt;/incBackupFlag&gt;<br>    &lt;incBackupFrequency&gt;1&lt;/incBackupFrequency&gt;<br>    &lt;incBackupDay&gt;3&lt;/incBackupDay&gt;<br>    &lt;incBackupHour&gt;7&lt;/incBackupHour&gt;<br>    &lt;incBackupMinutes&gt;0&lt;/incBackupMinutes&gt;<br>    &lt;serverType&gt;0&lt;/serverType&gt;<br>    &lt;updateVMList&gt;true&lt;/updateVMList&gt;<br>    &lt;backupThreshold&gt;10&lt;/backupThreshold&gt;<br>    &lt;hourEnd&gt;8&lt;/hourEnd&gt;<br>    &lt;minutesEnd&gt;0&lt;/minutesEnd&gt;<br>    &lt;incHourEnd&gt;8&lt;/incHourEnd&gt;<br>    &lt;incMinutesEnd&gt;10&lt;/incMinutesEnd&gt;<br>    &lt;vmList&gt;<br>        &lt;domainId&gt;313&lt;/domainId&gt;<br>    &lt;/vmList&gt;<br>    &lt;vmList&gt;<br>        &lt;domainId&gt;312&lt;/domainId&gt;<br>    &lt;/vmList&gt;<br>&lt;/backupStrategy&gt;
</pre>
      </div>
      <dt><b>回应</b></dt>
      <div class="source">
        <pre class="prettyprint lang-xml">无</pre>
      </div>
    </dl>
    
</div>
</div>
</div>
</body>
</html>